#include "DiagramInline.h"


DiagramInline::DiagramInline(NodeContainer* parent) : Node(parent), NodeContainer() { }


void DiagramInline::process(llvm::IRBuilder<> *builder) {
  for (std::vector<SourceTerminal*>::iterator it = inputTunnels.begin(); it != inputTunnels.end(); ++it) {
    (*it)->propagateValue();
  }
  processNodes(builder);
}

void DiagramInline::addSink() {
  //because our sinks will also sources
  SourceTerminal* inputTunnel = new SourceTerminal(this);
  terminals.push_back(inputTunnel);
  inputTunnels.push_back(inputTunnel);
  unassignedSinks++;
}

void DiagramInline::add(Node* child) {
  addNode(child);
}
